package com.example.demo.controller;

import com.example.demo.module.music.TtsMusicUtil;
import com.example.demo.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/*
 * @Author:大力王
 * @Date:2024/4/12-12-0:15
 * 开始了
 */
@RestController
@RequestMapping("/quartz")
@Api(tags = "定时任务接口")
public class QuartzController {

    @Resource
    private TtsMusicUtil ttsMusicUtil;

    @PostMapping("/getMusicUrl")
    @ApiOperation( value = "获取音乐地址")
    public Result getMusicUrl( String message) {
        String audio = ttsMusicUtil.syntheticAudio(message);
        return Result.success(audio).msg("获取成功");
    }
}
